NSColor *strokeColor = [NSColor clearColor];
if (isFirstResponder) {
- fillColor = [self highlightColor];
+ fillColor = [NSColor selectedTextBackgroundColor];
} else {
- fillColor = [self backgroundColor];
+ fillColor = [NSColor clearColor];
}
if (dropTarget) {
- fillColor = [NSColor colorWithRed:0.77 green:0.91 blue:0.96 alpha:1];
+ fillColor = [NSColor controlAccentColor];
}
[fillColor setFill];
[strokeColor setStroke];
NSBezierPath *roundRect = [NSBezierPath bezierPath];
- [roundRect appendBezierPathWithRoundedRectangle:cellFrame withRadius:cellRadiusFactor];
+ [roundRect appendBezierPathWithRoundedRectangle:cellFrame withRadius:NSHeight(cellFrame)/cellRadiusFactor];
[roundRect fill];
[self drawInteriorWithFrame:[self drawingRectForBounds:cellFrame] inView:controlView];
}
}
+- (void)drawIconForObject:(QSObject *)object withFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+ NSImage *image = [object icon];
+ NSString *iconName = nil;
+ NSImageSymbolConfiguration *iconConfig = nil;
+ if ([[image name] isEqualToString: @"defaultAction"]) {
+ iconName = @"gearshape.circle";
+ }
+ else if ([[image name] isEqualToString: @"Find"]) {
+ iconName = @"magnifyingglass";
+ }
+ else if ([[image name] isEqualToString: @"Object"]) {
+ iconName = @"cube.transparent";
+ iconConfig = [NSImageSymbolConfiguration configurationWithHierarchicalColor:[NSColor controlAccentColor]];
+ }
+ else if ([[image name] isEqualToString: @"ContactAddress"]) {
+ iconName = @"mappin.circle";
+ }
+ else if ([[image name] isEqualToString: @"ContactEmail"]) {
+ iconName = @"envelope.circle";
+ }
+ else if ([[image name] isEqualToString: @"ContactPhone"]) {
+ iconName = @"phone.circle";
+ }
+ else if ([[image name] isEqualToString: @"DefaultBookmarkIcon"]) {
+ iconName = @"link.circle";
+ }
+ else if ([[image name] isEqualToString: @"Catalog"]) {
+ iconName = @"sparkles.rectangle.stack";
+ }
+ else if ([[image name] isEqualToString: @"Triggers"]) {
+ iconName = @"bolt.fill";
+ }
+
+
+ if (iconName != nil) {
+ NSImage *newIcon = [NSImage imageWithSystemSymbolName:iconName accessibilityDescription:[image name]];
+
+ if (iconConfig == nil) {
+ NSArray *colors = [NSArray arrayWithObjects:[NSColor textColor], [NSColor controlAccentColor], nil];
+ iconConfig = [NSImageSymbolConfiguration configurationWithPaletteColors:colors];
+ }
+
+ QSObject *newObject = [QSObject objectWithName:[object name]];
+ [newObject setIcon:[newIcon imageWithSymbolConfiguration:iconConfig]];
+ [newObject setIconLoaded:[object iconLoaded]];
+ return [super drawIconForObject: newObject withFrame:cellFrame inView:controlView];
+ }
+
+ [super drawIconForObject: object withFrame:cellFrame inView:controlView];
+}
+
@end